/*
 * Copyright (C) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef IMAGE_KNIFE_C_CONSTANTS_H
#define IMAGE_KNIFE_C_CONSTANTS_H

namespace ImageKnifeC {
/**
 * 图片加载的code
 */
enum LoadPixelMapCode {
    // 排队时被取消
    QUEUE_CANCEL = 1000000,
    // 执行中被取消
    LOADING_CANCEL = 1000001,
    // 线程创建异常
    DISPATCH_THREAD = 1000002,
    // 生成key异常
    GENERATE_KEY = 1000003,
    // http请求失败
    HTTPS_LOAD_FAILED = 100300,
    // 本地资源加载失败
    LOAD_LOCAL_FILE_FAILED = 100401,
    // createImageSource 失败
    IMAGE_SOURCE_ERROR = 100501,
    // createPixelMap 失败
    IMAGE_PIXEL_MAP_ERROR = 100502
};

/**
 * 图片加载的各个阶段
 */
enum LoadPhase {
    // 调度阶段
    DISPATCH,
    // 内存缓存阶段
    MEMORY_CACHE,
    // 文件缓存阶段
    FILE_CACHE,
    // 网络加载阶段
    NETWORK_FETCH,
    // 本地资源加载阶段
    LOCAL_FETCH,
    // 自定义加载阶段
    CUSTOM_FETCH,
    // 解码阶段
    DECODE,
    // 降采样阶段
    DOWNSAMPLE,
    // 图形变换阶段
    TRANSFORM
};
}
#endif // IMAGE_KNIFE_C_CONSTANTS_H
